options=optimset('GradObj','on','MaxIter',100);
%GradObj ,on sets the gradient objective parameter to on
%MaxIter, Maximum number of iteratons to ,100
initialTheta=zeros(2,1);
[optTheta,functionVal,exitFlag]=fminunc(@costFunction,initialTheta,options);